package attend.action.emp;

import org.apache.log4j.Logger;


import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import attend.UserContainer.User;
import attend.com.CodeMetrix;
import attend.com.Session;
import attend.dao.common.CommonDao;
import attend.dao.dept.DeptDao;
import attend.dao.emp.EmpDao;
import attend.dao.vacation.VacationDao;
import dao.Paging.PagingDAO;
import exception.BaseException;

/**
 * <pre>
 * 사원관리 ACTION
 * </pre>
 * @author Yang D
 * @since	2009/02/02
 */
public class EmpAction extends Session {
	/**
	 * Logger for this class
	 */
	private static final Logger logger = Logger.getLogger(EmpAction.class);
	
	private String retired = "ALL";	//재직여부
	public String getRetired() 				{		return retired;			}
	public void setRetired(String retired) 	{		this.retired = retired;	}
	
	private String long_vaca = "ALL";	//휴직여부
	public String getLong_vaca() 				{		return long_vaca;			}
	public void setLong_vaca(String long_vaca) 	{		this.long_vaca = long_vaca;	}

	//	스퀀스 , 사번 , 팀 , 권한여부
	private String a_seq;
	
	private String[] 		a_emp_no , a_team_no , approv_yn;
	
	private String[]        a_emp_no2, vaca_sdate, vaca_edate, vaca_kind, reg_date, vaca_remark ;
	
	private String a_emp_no_i;
	private String vaca_sdate_i;
	private String vaca_edate_i;
	private String vaca_kind_i;
	private String reg_date_i;
	private String vaca_remark_i;
	
	
	private int 	h_emp_no;
	
	private String 	group_no; 

	
	private CommonDao 	commonDao;
	
	private EmpDao		empDao;
	
	private PagingDAO	pDao;
	
	private List<HashMap<String, String>> 	list 				= null;		//조회결과를 담는 Collection
	private List<HashMap<String, String>> 	listEmp 			= new ArrayList<HashMap<String,String>>();		//사원 List
	private List<HashMap<String, String>> 	listDept 			= new ArrayList<HashMap<String,String>>();		//사원 List
	
	private String		sgroup				=	"ALL";											//그룹/팀(부서)
	private String		semp_no				=	"ALL";											//사번
	private String		steam;
	private String		empNm;
	
	private String 		s_chk;
	private String      rtn_msg;
	
	//---------------
	private String		emp_no;
	private String		emp_nm;
	private String		user_id;
	private String		pass;
	private String		dept_no;		//부서
	private String		position_no;	//직위
	private String		rank_no;		//직급
	private String		work_yn;		//재직여부
	private String		apply_dt;		//입사일짜
	private String		retire_dt;		//퇴사일짜
	private String		in_time;		//출근시간
	private String		in_time_1;		//출근시간(시)
	private String		in_time_2;		//출근시간(분)
	private String		out_time;		//퇴근시간
	private String		out_time_1;		//퇴근시간(시)
	private String		out_time_2;		//퇴근시간(분)
	//---------------
	
	private int					rowCount				=	0;		//조회된 Row Count
	private int 				cur_page 				= 	1;		//Current Page Number

	private HashMap<String, String>			hmCondition;
	private HashMap<String, String>			emp_info;

	private List<HashMap<String, String>> 	listRank;
	private List<String>					listCondition;	

	private List<HashMap<String, String>> 	listPosition;

	private String msg;										//alert Message

	private String 							crud_type;
	//private String 							long_vaca;
	
	private DeptDao deptDao;

	private List<HashMap<String, String>> 	listGroup = new ArrayList<HashMap<String,String>>();
	private List<HashMap<String, String>>	listTeam = new ArrayList<HashMap<String,String>>();
	
	private String[] seq;

	private User user;

	private String modeType;
	
	private String	ch_seq_no;
	
	//private HashMap<String, String> in_time_1_list;
	
	/**
	 * @return
	 * @throws BaseException
	 */
	public String execute() throws BaseException , SQLException {
		
		commonDao	=	new CommonDao();
		
		//commonDao.retireveDept();			//부서조회 -(그룹/팀)
		commonDao.retrieveGroupByUseY();	//그룹 , use = y
		listGroup = commonDao.getList();
		
		//commonDao.retrieveTeamByGroupCd(sgroup);
		
		return SUCCESS;
	}
	
	/**
	 * <pre>
	 * 그룹/팀(부서)으로 소속한 사원들을 조회한다.
	 * </pre>
	 * @return
	 * @throws BaseException
	 */
	public String retrieveEmp() throws BaseException, SQLException {
		
		listEmp	=	new ArrayList<HashMap<String,String>>();
		
		if (sgroup == null) {
			return SUCCESS;
		}
		
		empDao	=	new		EmpDao();
		
		empDao.retrieveEmpByDeptNo(sgroup);
		
		listEmp	=	empDao.getList();
		
		//CRUD
		crud_type = CodeMetrix.UPDATE;

		return SUCCESS;
	}
	
	/**
	 * <pre>
	 * 사원관리 - 결과조회
	 * </pre>
	 * @return
	 * @throws BaseException
	 * @author Yang D
	 * @since	2009/02/04
	 */
	public String retrieveEmpListAjax() throws BaseException {
		
		if (	sgroup == null 	|| steam == null 	|| semp_no == null 	) {
			
			sgroup 	= CodeMetrix.ALL;
			steam 	= CodeMetrix.ALL;
			semp_no = CodeMetrix.ALL;
		}
		
		if (empNm == null || empNm.equals("")){
			empNm = CodeMetrix.ALL;
		}
		
		//if (long_vaca == null){
		//	long_vaca = long_vaca;
			
		//}
		System.out.println("long_vaca>>>>>>>>>>>>>>>>>>>>>"+long_vaca);
		
		int start_row				=	0;
		int end_row   				=	0;
		
		//Condition	//그룹/팀//사번
		hmCondition = new HashMap<String, String>();
		
		hmCondition.put("sgroup"	, 	sgroup	);						//그룹번호
		hmCondition.put("steam"		, 	steam	);						//팀
		hmCondition.put("semp_no"	, 	semp_no );						//사번
		hmCondition.put("retired"	, 	retired );						//사번		
		hmCondition.put("empNm"		, 	empNm );						//사원이름
		hmCondition.put("long_vaca"	, 	long_vaca );						//사번
		
		empDao	=	new		EmpDao();
		
		empDao.retrieveEmplistRowCount(hmCondition);
		
		rowCount	=	empDao.getRowCnt();								//조회건수
		
		pDao	=	new	PagingDAO(10 , 10 , rowCount , cur_page);				//페이징 처리 DAO
		
		start_row 					= pDao.getWriting_Start();				//시작 페이지 1
		end_row   					= pDao.getWriting_End();				//끝페이지
		
		
		hmCondition.put("start_row"	,	String.valueOf(start_row)	);		//시작row
		hmCondition.put("end_row"	,	String.valueOf(end_row)		);		//마지막 row
		
		empDao.retrieveEmpListAjax(hmCondition);
		
		list = empDao.getList();
		
		return SUCCESS;
	}
	
	/**
	 * <pre>사원관리 엑셀 다운로드</pre>
	 * @return
	 * @throws BaseException
	 * @throws SQLException
	 */
	public String empExcel() throws BaseException , SQLException {
		
		//Condition	//그룹/팀//사번
		hmCondition = new HashMap<String, String>();
		
		hmCondition.put("sgroup"	, 	sgroup	);						//그룹번호
		hmCondition.put("steam"		, 	steam	);						//팀
		hmCondition.put("semp_no"	, 	semp_no );						//사번
		hmCondition.put("retired"	, 	retired );						//사번
		hmCondition.put("long_vaca"	, 	long_vaca );						//사번
		
		empDao	=	new		EmpDao();
		
		empDao.retrieveEmplistRowCount(hmCondition);
		
		rowCount	=	empDao.getRowCnt();								//조회건수
		
		list = empDao.retrieveEmpExcel(hmCondition);
		
		logger.info(list);
		
		return SUCCESS;
	}
	
	/**
	 * <pre>
	 * 사원 등록
	 * flag value에 따라 구분 한다.
	 * </pre>
	 * @return
	 * @throws BaseException
	 * @author Yang D
	 * @throws SQLException 
	 * @since	2009/02/04
	 */
	public String openRegEmpPopup() throws BaseException, SQLException {
		
		//사원의 개인정보를 가져온다.
		
		empDao 				= 	new EmpDao();
		
		empDao.retrieveEmpByEmpNo(s_chk);
		
		list = empDao.getList();
		
		commonDao			=	new CommonDao();
		
		commonDao.retireveDept();			//부서조회 -(그룹/팀)
		
		listDept 			= 	commonDao.getList();
		
		commonDao.retireveCommonCode("106");		//직급
		
		listRank 			= 	commonDao.getList();
		
		commonDao.retireveCommonCode("107");		//직위
		
		listPosition 		= 	commonDao.getList();
		
		//사원정보 수정
		if (emp_no != null && !emp_no.equals("")) {
			
			crud_type	=	CodeMetrix.UPDATE;
			
			empDao.retrieveEmpByEmpNo(emp_no);
			
			emp_info	=	empDao.getEmp_info();
			
			dept_no		=	emp_info.get("team_no");
			semp_no		=	emp_info.get("emp_no");
			emp_nm		=	emp_info.get("emp_nm");
			user_id		=	emp_info.get("user_id");
			rank_no		=	emp_info.get("rank_nm");
			position_no	=	emp_info.get("position");
			
			//system error 방지 
			if (emp_info.get("apply_dt") == null || emp_info.get("apply_dt").equals("")) {
				apply_dt	=	null;
			} else {
				apply_dt	=	emp_info.get("apply_dt");
			}
			
			//system error 방지 
			if (emp_info.get("retire_dt") == null || emp_info.get("retire_dt").equals("")) {
				retire_dt	=	null;
			} else {
				retire_dt	=	emp_info.get("retire_dt");
			}

			
			work_yn		=	emp_info.get("work_yn");
			
			return SUCCESS;
		}
		
		//사원등록 입사날짜에 기본값으로 오늘날짜 입력
		apply_dt			=	commonDao.getDate(0);
		in_time_1	=	" 09";
		in_time_2	=	"05";
		out_time_1	=	" 18";
		out_time_2	=	"05";
		
		/*
		if (1 == 1) {
			return "modify";
		}
		*/
		return SUCCESS;
	}
	
	
	/**
	 * <pre>
	 * 사원 수정(이거임~~)
	 * flag value에 따라 구분 한다.
	 * </pre>
	 * @return
	 * @throws BaseException
	 * @author Yang D
	 * @throws SQLException 
	 * @since	2009/02/04
	 */
	public String openModEmpPopup() throws BaseException, SQLException {
		
		//사원의 개인정보를 가져온다.
		
		empDao 				= 	new EmpDao();
		
		empDao.retrieveEmpByEmpNo(s_chk);
		
		empDao.retrieveEmpVacation(emp_no);
		
		list = empDao.getList();
		
		commonDao			=	new CommonDao();
		
		commonDao.retireveDept();			//부서조회 -(그룹/팀)
		
		listDept 			= 	commonDao.getList();
		
		commonDao.retireveCommonCode("106");		//직급
		
		listRank 			= 	commonDao.getList();
		
		commonDao.retireveCommonCode("107");		//직위
		
		listPosition 		= 	commonDao.getList();
		
		//사원정보 수정
		if (emp_no != null && !emp_no.equals("")) {
			
			crud_type	=	CodeMetrix.UPDATE;
			
			empDao.retrieveEmpByEmpNo(emp_no);
			
			emp_info	=	empDao.getEmp_info();
			
			dept_no		=	emp_info.get("team_no");
			semp_no		=	emp_info.get("emp_no");
			emp_nm		=	emp_info.get("emp_nm");
			user_id		=	emp_info.get("user_id");
			rank_no		=	emp_info.get("rank_nm");
			position_no	=	emp_info.get("position");
			in_time_1	=	emp_info.get("in_time_1");
			in_time_2	=	emp_info.get("in_time_2");
			out_time_1	=	emp_info.get("out_time_1");
			out_time_2	=	emp_info.get("out_time_2");
			
			//system error 방지 
			if (emp_info.get("apply_dt") == null || emp_info.get("apply_dt").equals("")) {
				apply_dt	=	null;
			} else {
				apply_dt	=	emp_info.get("apply_dt");
			}
			
			//system error 방지 
			if (emp_info.get("retire_dt") == null || emp_info.get("retire_dt").equals("")) {
				retire_dt	=	null;
			} else {
				retire_dt	=	emp_info.get("retire_dt");
			}
			
			/*if (emp_info.get("in_time_1") == null || emp_info.get("in_time_1").equals("")) {
				in_time_1	=	" 09";
			} else {
				in_time_1	=	emp_info.get("in_time_1");
			}
			
			if (emp_info.get("in_time_2") == null || emp_info.get("in_time_2").equals("")) {
				in_time_2	=	"05";
			} else {
				in_time_2	=	emp_info.get("in_time_2");
			}
			
			//system error 방지 
			if (emp_info.get("out_time_1") == null || emp_info.get("out_time_1").equals("")) {
				out_time_1	=	" 18";
			} else {
				out_time_1	=	emp_info.get("out_time_1");
			}
			
			if (emp_info.get("out_time_2") == null || emp_info.get("out_time_2").equals("")) {
				out_time_2	=	"05";
			} else {
				out_time_2	=	emp_info.get("out_time_2");
			}
			*/
			
			
			work_yn		=	emp_info.get("work_yn");
			
			return SUCCESS;
		}
		
		//사원등록 입사날짜에 기본값으로 오늘날짜 입력
		apply_dt			=	commonDao.getDate(0);
		in_time_1	=	" 09";
		in_time_2	=	"05";
		out_time_1	=	" 18";
		out_time_2	=	"05";
		//reg_date            =   commonDao.getDate(0);
		
		/*
		if (1 == 1) {
			return "modify";
		}
		*/
		return SUCCESS;
	}
	
	/**
	 * <pre>
	 * 저장버튼.
	 * </pre>
	 * @return
	 * @throws BaseException
	 * @throws SQLException 
	 */
	public String saveEmpInfo() throws BaseException, SQLException {
		System.out.println("여기로 오는거니??");
		
		in_time = in_time_1 + ":" + in_time_2;
		out_time = out_time_1 + ":" + out_time_2;
		
		//in_time_1_list = new HashMap<String,String>();
		//in_time_1_list.put(" 05","05" );
		//in_time_1_list.put(" 06","06" );
		//in_time_1_list.put(" 07","07" );
		
		
		hmCondition = new HashMap<String,String>();
		
		hmCondition.put("emp_no"		, emp_no   		);
		hmCondition.put("emp_nm"		, emp_nm  		);
		hmCondition.put("user_id"		, user_id     	);
		hmCondition.put("pass"			, pass   		);
		hmCondition.put("dept_no"		, dept_no		);
		hmCondition.put("position_no"	, position_no  	);
		hmCondition.put("rank_no"		, rank_no  		);
		hmCondition.put("work_yn"		, work_yn 		);
		hmCondition.put("apply_dt"		, apply_dt		);
		hmCondition.put("retire_dt"		, retire_dt		);
		hmCondition.put("in_time"		, in_time		);
		hmCondition.put("out_time"		, out_time		);

		empDao	=	new EmpDao();
		
		//사원정보수정
		if (crud_type.equals(CodeMetrix.UPDATE)) {
			
			empDao.updateEmpInfo(hmCondition);
			msg	=	empDao.getMsg();
			
			//SYSTEM ERROR FIX
			commonDao			=	new CommonDao();
			
			commonDao.retireveDept();			//부서조회 -(그룹/팀)
			
			listDept 			= 	commonDao.getList();
			
			commonDao.retireveCommonCode("106");		//직급
			
			listRank 			= 	commonDao.getList();
			
			commonDao.retireveCommonCode("107");		//직위
			
			listPosition 		= 	commonDao.getList();
			//SYSTEM ERROR FIX
			
			//system error 방지 
			if (apply_dt == null || apply_dt.equals("")) {
				apply_dt	=	null;
			}
			
			//system error 방지 
			if (retire_dt == null || retire_dt.equals("")) {
				retire_dt	=	null;
			}
			
			if (in_time == null || in_time.equals("")) {
				in_time	=	null;
			}
			
			//system error 방지 
			if (out_time == null || out_time.equals("")) {
				out_time	=	null;
			}
			
			return SUCCESS;
		}
		
		empDao.insertEmpInfo(hmCondition);				//사원등록
		
		msg	=	empDao.getMsg();
		
		System.out.println(msg + "                    #################################################      MESSAGE");
		
		//SYSTEM ERROR FIX
		commonDao			=	new CommonDao();
		
		commonDao.retireveDept();			//부서조회 -(그룹/팀)
		
		listDept 			= 	commonDao.getList();
		
		commonDao.retireveCommonCode("106");		//직급
		
		listRank 			= 	commonDao.getList();
		
		commonDao.retireveCommonCode("107");		//직위
		
		listPosition 		= 	commonDao.getList();
		//SYSTEM ERROR FIX
		
		return SUCCESS;
	}
	
	/**
	 * <pre>부서권한부여</pre>
	 * @return
	 * @throws BaseException
	 * @throws SQLException 
	 */
	public String openEmpDeptAuth() throws BaseException, SQLException {
		
		empDao		=	new	EmpDao();
		
		deptDao		=	new DeptDao();
		
		empDao.retrieveEmpDeptAuth(emp_no);
		list		=	empDao.getList();
		
		//list GROUP
		commonDao	=	new CommonDao();
		
		commonDao.retrieveGroupList();
		
		setListGroup(commonDao.getList());
		
		listGroup 	= 	commonDao.getList();
		
		//사원테이블에서 정보를 가져옴.
		empDao.searchEmpInfo(emp_no);
		emp_info	=	empDao.getEmp_info();
		
		return SUCCESS;
	}
	
	/**
	 * <pre>휴직정보</pre>
	 * @return
	 * @throws BaseException
	 * @throws SQLException 
	 */
	public String openEmpDeptLongvacation() throws BaseException, SQLException {
		
		empDao		=	new	EmpDao();
		
		deptDao		=	new DeptDao();
		
		//empDao.retrieveEmpDeptAuth(emp_no);
		//empDao.retrieveEmpByEmpNo(emp_no);
		empDao.retrieveEmpVacation(emp_no);
		list		=	empDao.getList();
		
		//list GROUP
		commonDao	=	new CommonDao();
		
		commonDao.retrieveGroupList();
		
		setListGroup(commonDao.getList());
		
		listGroup 	= 	commonDao.getList();
		
		//사원테이블에서 정보를 가져옴.
		empDao.searchEmpInfo(emp_no);
		emp_info	=	empDao.getEmp_info();

		//reg_date[0]			=  "05";
		
		return SUCCESS;
	}
	
	/**
	 * <pre>휴직정보 수정팝업창</pre>
	 * @return
	 * @throws BaseException
	 * @throws SQLException 
	 */
	public String updateEmpDeptLongvacation() throws BaseException, SQLException {
		
		empDao		=	new	EmpDao();
		
		deptDao		=	new DeptDao();
		
		
		System.out.println("seq>>>>>>>>>>>>>>"+ch_seq_no);
		System.out.println("emp_no>>>>>>>>>>>"+emp_no);
		listCondition = new ArrayList<String>();
		
		//int idx = 0;		//index 초기화
		
		//listCondition.add(idx++ , ch_seq_no );		//체크된 값-SEQ--1,2,3,4
		
		//empDao		=	new	EmpDao();
		
		//empDao.update_EmpVacation_p(listCondition);
		
		//empDao.retrieveEmpDeptAuth(emp_no);
		//empDao.retrieveEmpByEmpNo(emp_no);
		empDao.retrieveEmpVacation(emp_no,ch_seq_no);
		list		=	empDao.getList();
		
		empDao.searchEmpInfo(emp_no);
		emp_info	=	empDao.getEmp_info();
		
		//list GROUP
		//commonDao	=	new CommonDao();
		
		//commonDao.retrieveGroupList();
		
		//setListGroup(commonDao.getList());
		
		//listGroup 	= 	commonDao.getList();
		
		//사원테이블에서 정보를 가져옴.
		//empDao.searchEmpInfo(emp_no);
		//emp_info	=	empDao.getEmp_info();

		//reg_date[0]			=  "05";
		
		return SUCCESS;
	}


	/**
	 * <pre>사원 부서 권한 등록/수정</pre>
	 * @return
	 * @throws BaseException
	 */
	public String saveEmpDept() throws BaseException {
		
		empDao	=	new EmpDao();
		empDao.saveEmpDept(h_emp_no , a_seq , a_emp_no , a_team_no , approv_yn);
		setMsg(empDao.getMsg());
		
		if (msg.equals(CodeMetrix.DUPLICATE)) {
			return "duplicate";
		}
		return SUCCESS;
	}
	
	/**
	 * <pre>사원 휴직정보 등록</pre>
	 * @return
	 * @throws BaseException
	 */
	public String saveEmpVacation() throws BaseException {
		
		System.out.println("안녕 여기여기 일단 액션페이지임");
		
		empDao	=	new EmpDao();
		empDao.saveEmpVacation(h_emp_no , a_seq , a_emp_no2 , vaca_sdate , vaca_edate, vaca_kind, reg_date, vaca_remark);
		//empDao.saveEmpVacation(h_emp_no , a_seq , a_emp_no2 , vaca_sdate , vaca_edate, vaca_kind, reg_date, vaca_remark);
		
		setMsg(empDao.getMsg());
		if (msg.equals(CodeMetrix.DUPLICATE)) {
			return "duplicate";
		}
		//msg	=	empDao.getMsg();
		
		//if (msg.equals(CodeMetrix.DUPLICATE)) {
		//	return "duplicate";
		//}
		return SUCCESS;
	}
	
	/**
	 * <pre>사원 휴직정보 수정</pre>
	 * @return
	 * @throws BaseException
	 */
	/*public String updateEmpVacation() throws BaseException , SQLException {
		
		System.out.println("안녕 휴직수정 액션페이지임");
		
		empDao	=	new EmpDao();
		empDao.updateEmpVacation(h_emp_no , a_seq , a_emp_no2 , vaca_sdate , vaca_edate, vaca_kind, reg_date, vaca_remark);
		
		setMsg(empDao.getMsg());
		
		openModEmpPopup();

		return SUCCESS;
	}*/
	
	/**
	 * <pre>사원 휴직정보 수정</pre>
	 * @return
	 * @throws BaseException
	 */
	public String updateEmpVacation() throws BaseException , SQLException {
		
		System.out.println("안녕 수정 수정 여기여기 일단 액션페이지임");
		
		empDao	=	new EmpDao();
		empDao.updateEmpVacation(h_emp_no , a_seq , a_emp_no2 , vaca_sdate , vaca_edate, vaca_kind, reg_date, vaca_remark);
		//empDao.saveEmpVacation(h_emp_no , a_seq , a_emp_no2 , vaca_sdate , vaca_edate, vaca_kind, reg_date, vaca_remark);
		
		setMsg(empDao.getMsg());
		
		if (msg.equals(CodeMetrix.DUPLICATE)) {
			return "duplicate";
		}

		
		//updateEmpDeptLongvacation();
		//openModEmpPopup();
		

		//if (msg.equals(CodeMetrix.DUPLICATE)) {
		//	return "duplicate";
		//}
		//msg	=	empDao.getMsg();
		
		//if (msg.equals(CodeMetrix.DUPLICATE)) {
		//	return "duplicate";
		//}
		return SUCCESS;
	}
	
	
	/**
	 * 사원 휴직 수정(수정후) 
	 * 
	 * @return
	 * @throws BaseException
	 * @throws SQLException
	 */
	public String update_EmpVacation() throws BaseException , SQLException {
		System.out.println("여기 휴직정보 delete함,,");
		
		//if (!session.containsKey("user")) {
		//	return "login";
		//}
		
		//user = (User) session.get("user");
		
		//empInfo = user.getEmpInfo();
		
		//logger.info("ch_seq_no--->	" + ch_seq_no);
		
		//조건들을 list에 담아서 넘긴다.
		System.out.println("seq>>>"+ch_seq_no);
		listCondition = new ArrayList<String>();
		
		int idx = 0;		//index 초기화
		
		listCondition.add(idx++ , ch_seq_no );		//체크된 값-SEQ--1,2,3,4
		
		empDao		=	new	EmpDao();
		
		empDao.update_EmpVacation_p(listCondition);
		
		setMsg(empDao.getMsg());
		openModEmpPopup();
		
		
		//setMsg(empDao.getMsg());
			
		System.out.println("휴가배정 DELETE");

		//commonDao			=	new CommonDao();
		
		//commonDao.retireveDept();			//부서조회 -(그룹/팀)
		
		//listDept 			= 	commonDao.getList();
		
		//commonDao.retireveCommonCode("106");		//직급
		
		//listRank 			= 	commonDao.getList();
		
		//commonDao.retireveCommonCode("107");		//직위
		
		//listPosition 		= 	commonDao.getList();
		
		//setMsg(empDao.getMsg());
		//setMsg(empDao.getMsg());

		//msg	=	empDao.getRtn_msg();
		
		//if (msg.equals(CodeMetrix.DELETE)) {
		//	return "DELETE";
		//}
		
		return SUCCESS;
	}

	/**
	 * 사원 휴직 삭제 DELETE
	 * 
	 * @return
	 * @throws BaseException
	 * @throws SQLException
	 */
	public String deleteEmpVacation() throws BaseException , SQLException {
		System.out.println("여기 휴직정보 delete함,,");
		
		//if (!session.containsKey("user")) {
		//	return "login";
		//}
		
		//user = (User) session.get("user");
		
		//empInfo = user.getEmpInfo();
		
		//logger.info("ch_seq_no--->	" + ch_seq_no);
		
		//조건들을 list에 담아서 넘긴다.
		System.out.println("seq>>>"+ch_seq_no);
		listCondition = new ArrayList<String>();
		
		int idx = 0;		//index 초기화
		
		listCondition.add(idx++ , ch_seq_no );		//체크된 값-SEQ--1,2,3,4
		
		empDao		=	new	EmpDao();
		
		empDao.deleteEmpVacation_p(listCondition);
		
		setMsg(empDao.getMsg());
		openModEmpPopup();
		
		
		//setMsg(empDao.getMsg());
			
		System.out.println("휴가배정 DELETE");

		//commonDao			=	new CommonDao();
		
		//commonDao.retireveDept();			//부서조회 -(그룹/팀)
		
		//listDept 			= 	commonDao.getList();
		
		//commonDao.retireveCommonCode("106");		//직급
		
		//listRank 			= 	commonDao.getList();
		
		//commonDao.retireveCommonCode("107");		//직위
		
		//listPosition 		= 	commonDao.getList();
		
		//setMsg(empDao.getMsg());
		//setMsg(empDao.getMsg());

		//msg	=	empDao.getRtn_msg();
		
		//if (msg.equals(CodeMetrix.DELETE)) {
		//	return "DELETE";
		//}
		
		return SUCCESS;
	}
	
	/**
	 * <pre>비밀번호 초기화</pre>
	 * @return	String
	 * @throws BaseException
	 * @author Yang D
	 * @since	2009/03/13
	 */
	public String initPassWord() throws BaseException {
		
		empDao	=	new EmpDao();
		empDao.initPassword(Integer.valueOf(emp_no) , user_id , dept_no);
		msg = empDao.getMsg();
		
		return SUCCESS;
	}
	
	/**
	 * <pre>ID 중복 체크하기</pre>
	 * @return
	 * @throws BaseException
	 */
	public String empIdDupCheck() throws BaseException {
		
		empDao	=	new	EmpDao();
		if (modeType.equals("VERIFICATION")) {
			empDao.retrieveIdById(user_id);
		}
		
		msg	=	empDao.getMsg();
		
		return SUCCESS;
	}
	/****************************GETTER / SETTER******************************/
	
	

	public List<HashMap<String, String>> getList() {
		return list;
	}

	public void setList(List<HashMap<String, String>> list) {
		this.list = list;
	}

	public String getSgroup() {
		return sgroup;
	}

	public void setSgroup(String sgroup) {
		this.sgroup = sgroup;
	}

	public List<HashMap<String, String>> getListEmp() {
		return listEmp;
	}

	public void setListEmp(List<HashMap<String, String>> listEmp) {
		this.listEmp = listEmp;
	}

	public String getSemp_no() {
		return semp_no;
	}

	public void setSemp_no(String semp_no) {
		this.semp_no = semp_no;
	}

	public PagingDAO getpDao() {
		return pDao;
	}

	public void setpDao(PagingDAO pDao) {
		this.pDao = pDao;
	}

	public int getCur_page() {
		return cur_page;
	}

	public void setCur_page(int cur_page) {
		this.cur_page = cur_page;
	}

	public int getRowCount() {
		return rowCount;
	}

	public void setRowCount(int rowCount) {
		this.rowCount = rowCount;
	}

	public List<HashMap<String, String>> getListDept() {
		return listDept;
	}

	public void setListDept(List<HashMap<String, String>> listDept) {
		this.listDept = listDept;
	}

	public List<HashMap<String, String>> getListRank() {
		return listRank;
	}

	public void setListRank(List<HashMap<String, String>> listRank) {
		this.listRank = listRank;
	}

	public List<HashMap<String, String>> getListPosition() {
		return listPosition;
	}

	public void setListPosition(List<HashMap<String, String>> listPosition) {
		this.listPosition = listPosition;
	}

	public String getEmp_no() {
		return emp_no;
	}

	public void setEmp_no(String emp_no) {
		this.emp_no = emp_no;
	}

	public String getUser_id() {
		return user_id;
	}

	public void setUser_id(String user_id) {
		this.user_id = user_id;
	}

	public String getPass() {
		return pass;
	}

	public void setPass(String pass) {
		this.pass = pass;
	}

	public String getDept_no() {
		return dept_no;
	}

	public void setDept_no(String dept_no) {
		this.dept_no = dept_no;
	}

	public String getPosition_no() {
		return position_no;
	}

	public void setPosition_no(String position_no) {
		this.position_no = position_no;
	}

	public String getRank_no() {
		return rank_no;
	}

	public void setRank_no(String rank_no) {
		this.rank_no = rank_no;
	}

	public String getWork_yn() {
		return work_yn;
	}

	public void setWork_yn(String work_yn) {
		this.work_yn = work_yn;
	}

	public String getApply_dt() {
		return apply_dt;
	}

	public void setApply_dt(String apply_dt) {
		this.apply_dt = apply_dt;
	}

	public String getRetire_dt() {
		return retire_dt;
	}

	public void setRetire_dt(String retire_dt) {
		this.retire_dt = retire_dt;
	}
	
	public String getIn_time() {
		return in_time;
	}

	public void setIn_time(String in_time) {
		this.in_time = in_time;
	}
	
	public String getOut_time() {
		return out_time;
	}

	public void setOut_time(String out_time) {
		this.out_time = out_time;
	}
	
	public String getIn_time_1() {
		return in_time_1;
	}

	public void setIn_time_1(String in_time_1) {
		this.in_time_1 = in_time_1;
	}
	
	public String getIn_time_2() {
		return in_time_2;
	}

	public void setIn_time_2(String in_time_2) {
		this.in_time_2 = in_time_2;
	}
	
	public String getOut_time_1() {
		return out_time_1;
	}

	public void setOut_time_1(String out_time_1) {
		this.out_time_1 = out_time_1;
	}
	
	public String getOut_time_2() {
		return out_time_2;
	}

	public void setOut_time_2(String out_time_2) {
		this.out_time_2 = out_time_2;
	}
	
	public String getEmp_nm() {
		return emp_nm;
	}

	public void setEmp_nm(String emp_nm) {
		this.emp_nm = emp_nm;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public String getS_chk() {
		return s_chk;
	}

	public void setS_chk(String s_chk) {
		this.s_chk = s_chk;
	}

	public HashMap<String, String> getEmp_info() {
		return emp_info;
	}

	public void setEmp_info(HashMap<String, String> emp_info) {
		this.emp_info = emp_info;
	}

	public String getCrud_type() {
		return crud_type;
	}

	public void setCrud_type(String crud_type) {
		this.crud_type = crud_type;
	}

	public List<HashMap<String, String>> getListGroup() {
		return listGroup;
	}

	public void setListGroup(List<HashMap<String, String>> listGroup) {
		this.listGroup = listGroup;
	}

	public List<HashMap<String, String>> getListTeam() {
		return listTeam;
	}

	public void setListTeam(List<HashMap<String, String>> listTeam) {
		this.listTeam = listTeam;
	}

	public String getSteam() {
		return steam;
	}

	public void setSteam(String steam) {
		this.steam = steam;
	}

	@Override
	public void setUser(User user) {
		this.user = user;
		
	}

	public User getUser() {
		return user;
	}
	/****************************GETTER / SETTER******************************/

	public String getA_seq() {
		return a_seq;
	}

	public void setA_seq(String a_seq) {
		this.a_seq = a_seq;
	}

	public String[] getA_emp_no() {
		return a_emp_no;
	}

	public void setA_emp_no(String[] a_emp_no) {
		this.a_emp_no = a_emp_no;
	}

	public String[] getA_team_no() {
		return a_team_no;
	}

	public void setA_team_no(String[] a_team_no) {
		this.a_team_no = a_team_no;
	}

	public String[] getApprov_yn() {
		return approv_yn;
	}

	public void setApprov_yn(String[] approv_yn) {
		this.approv_yn = approv_yn;
	}

	public int getH_emp_no() {
		return h_emp_no;
	}

	public void setH_emp_no(int h_emp_no) {
		this.h_emp_no = h_emp_no;
	}

	public String getGroup_no() {
		return group_no;
	}

	public void setGroup_no(String group_no) {
		this.group_no = group_no;
	}

	/**
	 * @return the modeType
	 */
	public String getModeType() {
		return modeType;
	}

	/**
	 * @param modeType the modeType to set
	 */
	public void setModeType(String modeType) {
		this.modeType = modeType;
	}
	public String getEmpNm() {
		return empNm;
	}
	public void setEmpNm(String empNm) {
		this.empNm = empNm;
	}
	
	public String[] getA_emp_no2() {
		return a_emp_no2;
	}

	public void setA_emp_no2(String[] a_emp_no2) {
		this.a_emp_no2 = a_emp_no2;
	}
	
	public String[] getVaca_sdate() {
		return vaca_sdate;
	}

	public void setVaca_sdate(String[] vaca_sdate) {
		this.vaca_sdate = vaca_sdate;
	}
	
	public String[] getVaca_edate() {
		return vaca_edate;
	}

	public void setVaca_edate(String[] vaca_edate) {
		this.vaca_edate = vaca_edate;
	}
	
	public String[] getVaca_kind() {
		return vaca_kind;
	}

	public void setVaca_kind(String[] vaca_kind) {
		this.vaca_kind = vaca_kind;
	}
	
	public String[] getReg_date() {
		return reg_date;
	}

	public void setReg_date(String[] reg_date) {
		this.reg_date = reg_date;
	}
	
	public String[] getVaca_remark() {
		return vaca_remark;
	}

	public void setVaca_remark(String[] vaca_remark) {
		this.vaca_remark = vaca_remark;
	}
	
	public String getA_emp_no_i() {
		return a_emp_no_i;
	}

	public void setA_emp_no_i(String a_emp_no_i) {
		this.a_emp_no_i = a_emp_no_i;
	}
	
	public String getVaca_sdate_i() {
		return vaca_sdate_i;
	}

	public void setVaca_sdate_i(String vaca_sdate_i) {
		this.vaca_sdate_i = vaca_sdate_i;
	}
	
	public String getVaca_edate_i() {
		return vaca_edate_i;
	}

	public void setVaca_edate_i(String vaca_edate_i) {
		this.vaca_edate_i = vaca_edate_i;
	}
	
	public String getVaca_kind_i() {
		return vaca_kind_i;
	}

	public void setVaca_kind_i(String vaca_kind_i) {
		this.vaca_kind_i = vaca_kind_i;
	}
	
	public String getReg_date_i() {
		return reg_date_i;
	}

	public void setReg_date_i(String reg_date_i) {
		this.reg_date_i = reg_date_i;
	}
	
	public String getVaca_remark_i() {
		return vaca_remark_i;
	}

	public void setVaca_remark_i(String vaca_remark_i) {
		this.vaca_remark_i = vaca_remark_i;
	}
	
	public String getCh_seq_no() {
		return ch_seq_no;
	}
	public void setCh_seq_no(String chSeqNo) {
		ch_seq_no = chSeqNo;
	}
	
	public List<String> getListCondition() {
		return listCondition;
	}

	public void setListCondition(List<String> listCondition) {
		this.listCondition = listCondition;
	}
	
	public String getRtn_msg() {
		return rtn_msg;
	}

	public void setRtn_msg(String rtn_msg) {
		this.rtn_msg = rtn_msg;
	}
	
	//public Map<String, String> getIn_time_1_list(){
	//	return in_time_1_list;
		
	//}
	
	//public void setIn_time_1_list(Map<String, String> in_time_list_1_list){
	//	this.in_time_1_list = in_time_1_list;
	//}

}
